package com.doubletick.proxy.ipidea.async;

import com.doubletick.common.utils.spring.SpringUtils;
import com.doubletick.proxy.ipidea.domain.ProxyAccount;
import com.doubletick.proxy.ipidea.task.ProxyTask;
import lombok.extern.slf4j.Slf4j;

import java.util.TimerTask;

@Slf4j
public class AsyncProxyFactory {


    public static TimerTask bindProxyId(ProxyAccount proxyAccount) {
        return new TimerTask() {
            @Override
            public void run() {
                log.info("定时任务开始执行，查询代理id为空的数据:" + proxyAccount.getAccount());
                SpringUtils.getBean(ProxyTask.class).reloadConsumerFlow();
            }
        };
        /*return new TimerTask() {
            @Override
            public void run() {
                log.info("定时任务开始执行，查询代理id为空的数据:" + proxyAccount.getAccount());
                SpringUtils.getBean(ProxyTask.class).reloadConsumerFlow();

            }
        };*/
    }
}
